{% extends '@Default/relationshiplayout.twig' %}


{% block content %}

    <h2>Projects</h2>

    <hr>

    <table class="table" id="table">
        <thead>
            <tr>
                <th>Name</th>
                <th>Customer</th>
                <th>Starting Date</th>
            </tr>
        </thead>
        <tbody>
            {% for obj in list %}
                <tr>
                    <td>
                        <a href="{{ app.urlFor('Relationship-Products',{projectId:obj.getId()}) }}">
                            {{ obj.getName() }}
                        </a>
                    </td>
                    <td>{{ obj.getCustomer().getName() }}</td>
                    <td>{{ obj.getStartingDate().format('m/d/Y') }}</td>
                </tr>
            {% endfor %}
        </tbody>
    </table>


    <script type="text/javascript">
        jQuery( document ).ready( function( $ ) {
            var $table = jQuery( "#table" );
            $table.DataTable( {
                dom: 'Bfrtip',
                buttons: [
                    'copy', 'csv', 'excel', {
                        extend: 'pdfHtml5',
                        title: 'List of Projects',
                        text: 'PDF'
                    }
                ]
            } );
        } );
    </script>
{% endblock %}